﻿Public Class ColorQuery
    Inherits LoverQuery

    <System.ComponentModel.DefaultValue(0)>
    Public Property MinimumHue As Integer
        Get
            If Me.ContainsKey("hueRange") Then
                Return CType(Me!hueRange, Integer())(0)
            End If

            Return 0
        End Get
        Set(ByVal value As Integer)
            If Me.ContainsKey("hueRange") Then
                CType(Me!hueRange, Integer())(0) = value
            Else
                Me!hueRange = {value, 359}
            End If
        End Set
    End Property
    <System.ComponentModel.DefaultValue(359)>
    Public Property MaximumHue As Integer
        Get
            If Me.ContainsKey("hueRange") Then
                Return CType(Me!hueRange, Integer())(1)
            End If

            Return 359
        End Get
        Set(ByVal value As Integer)
            If Me.ContainsKey("hueRange") Then
                CType(Me!hueRange, Integer())(1) = value
            Else
                Me!hueRange = {0, value}
            End If
        End Set
    End Property
    <System.ComponentModel.DefaultValue(0)>
    Public Property MinimumBrightness As Integer
        Get
            If Me.ContainsKey("briRange") Then
                Return CType(Me!briRange, Integer())(0)
            End If

            Return 0
        End Get
        Set(ByVal value As Integer)
            If Me.ContainsKey("briRange") Then
                CType(Me!briRange, Integer())(0) = value
            Else
                Me!briRange = {value, 359}
            End If
        End Set
    End Property
    <System.ComponentModel.DefaultValue(99)>
    Public Property MaximumBrightness As Integer
        Get
            If Me.ContainsKey("briRange") Then
                Return CType(Me!briRange, Integer())(1)
            End If

            Return 9
        End Get
        Set(ByVal value As Integer)
            If Me.ContainsKey("briRange") Then
                CType(Me!briRange, Integer())(1) = value
            Else
                Me!briRange = {0, value}
            End If
        End Set
    End Property
End Class
